package mystia.lorelei.app.repository;

import mystia.lorelei.app.entity.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.sql.Date;
import java.util.List;

public interface EmployeeRepository extends JpaRepository<Employee,Integer> {
	@Query("update Employee set exited = ?1,exitTime = ?2 where id = ?3")
	public void updateExitedById(boolean exited, Date date,int id);
	
	@Query(value = "delete from employee e where e.id in ?1",nativeQuery = true)
	public void deleteAllByIds(List<Integer> ids);
}
